package com.winspread.app.paging

import retrofit2.Retrofit
import retrofit2.converter.gson.GsonConverterFactory
import retrofit2.http.GET
import retrofit2.http.Query

/**
 *Author: Amin
 *Data: 2023/4/12 9:35
 *
 *Description:
 *
 */
interface GitHubService {

    @GET("search/repositories?sort=stars&q=Android")
    suspend fun searchRepos(@Query("page") page: Int, @Query("per_page") perPage: Int): RepoResponse


    companion object {
        private const val BASE_URL = "https://api.github.com/"
        fun create(): GitHubService =
            Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory.create()).build()
                .create(GitHubService::class.java)

    }

}